import api from "@/utils/service";

export const surveyList = (data) => {
  return api({
    url: "/survey/list",
    method: "get",
    params: { ...data },
  });
};

export const surveyDetails = (data) => {
  return api({
    url: "/survey/details",
    method: "get",
    params: { ...data },
  });
};

export const multiReview = (data) => {
  return api({
    url: "/member/complete/multiReview",
    method: "post",
    data,
  });
};

export const surveyEdit = (data) => {
  return api({
    url: "/survey/edit",
    method: "post",
    data,
  });
};
export const qualificationsGroup = (tid) => {
  return api({
    url: `/survey/qualificationsGroup?tid=${tid}`,
    method: "get",
  });
};
export const editQualificationsGroup = (tid, data) => {
  return api({
    url: `/survey/editQualificationsGroup?tid=${tid}`,
    method: "post",
    data,
  });
};

export const delQualificationsGroup = (groupId) => {
  return api({
    url: `/survey/delQualificationsGroup?groupId=${groupId}`,
    method: "post",
  });
};

export const editQualifications = (groupId, data) => {
  return api({
    url: `/survey/editQualifications?groupId=${groupId}`,
    method: "post",
    data,
  });
};

export const delQualificationsByQuestion = (qid) => {
  return api({
    url: `/survey/delQualificationsByQuestion?qid=${qid}`,
    method: "post",
  });
};

export const qualifications = (groupId) => {
  return api({
    url: `/survey/qualifications?groupId=${groupId}`,
    method: "get",
  });
};
export const matchQualificationsGroup = (groupId) => {
  return api({
    url: `/survey/matchQualificationsGroup?groupId=${groupId}`,
    method: "post",
  });
};
export const qualificationsGroupPush = (groupId) => {
  return api({
    url: `/survey/qualificationsGroupPush?groupId=${groupId}`,
    method: "post",
  });
};

export const profile = () => {
  return api({
    url: `/profile`,
    method: "get",
  });
};

export const editStatus = (data) => {
  return api({
    url: `/survey/editStatus?tid=${data.tid}&status=${data.status}`,
    method: "post",
  });
};

export const customerList = (data) => {
  return api({
    url: "/customer/list",
    method: "get",
    params: { ...data },
  });
};

export const adminList = (data) => {
  return api({
    url: "/member/adminList",
    method: "get",
    params: { ...data },
  });
};
